<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="t" tagdir="/WEB-INF/tags" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<t:emptyTemplate>
	
	<script type="text/javascript" src="site/js/maps_distance.js"></script>
	
	<script>
	window.onload = loadScript;
	
	makeDropDownSelector('barrioOrig', 'barrio', null, true);
	
	makeDropDownSelector('barrioDest', 'barrio', null, true);
	
	
	function initialize() {
		geocoder = new google.maps.Geocoder();
		
	}
	 
	function loadScript() {
	  var script = document.createElement("script");
	  script.type = "text/javascript";
	  script.src = "http://maps.googleapis.com/maps/api/js?key=AIzaSyBUP3Hs9PaOKAn7DjHGPWfeosglumrlTe0&sensor=false&callback=initialize";
	  document.body.appendChild(script);
	}
	
	//action="cliente?action=pedir"
	</script>

	<c:choose>
		<c:when test="${entity.estado == 'POR_ASIGNAR' || entity.estado == 'ASIGNADO'}">
			<div>Datos viaje: ${entity.pasajero} - ${entity.origen_str} - ${entity.destino_str}</div>
			<div>Chofer actual: ${entity.chofer.id} - ${entity.chofer.nombre} ${entity.chofer.apellido}</div>
	
			<br>
			
			<input type="button" onclick="reasignarViaje();" value="Reasignar"/>
			
			<div id="outputDiv"></div>
		</c:when>
		<c:otherwise>
			<span>No se puede reasignar este viaje.</span>
		</c:otherwise>
	</c:choose>
	
	<input type="hidden" id="idviaje" value="${entity.id}"/>
	<input type="hidden" id="calleOrigen" value="${entity.origen_str}"/>
	<input type="hidden" id="idchoferactual" value="${entity.chofer.id}"/>
	
</t:emptyTemplate>